<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Zipcode_model extends CI_Model {

	function __construct() {
		parent::__construct();

		$this->load->library('LogSql');
	}

	/**
	 * 우편번호 검색
	 */
	function select_zipcode_list($search_string) {
		$sql  = PHP_EOL." SELECT zipcode, TRIM(CONCAT_WS(' ', address1, address2, address3, address4, address5, address7)) addr, address_full ";
		$sql .= PHP_EOL." FROM  tb_zipcode ";
		$sql .= PHP_EOL." WHERE address3 LIKE '$search_string%' ";
		$sql .= PHP_EOL." OR    address4 LIKE '$search_string%' ";
		$sql .= PHP_EOL." ORDER BY address_full ";
		// $sql .= PHP_EOL." LIMIT 0 , 30 ";
        $query = $this->db->query($sql);
		$result = $query->result_array();
		
		return $result;
	}

}

/* End of file zipcode_model.php */
/* Location: ./application/models/member/zipcode_model.php */